package example2;

/**
 * <h3>designPattern</h3>
 * <p>日本变压适配器</p>
 * @author : zhang.bw
 * @date : 2021-02-25 17:59
 **/
public class JapanPowerAdapter implements DC5Adapter {
	public static final int voltage = 110;

	@Override
	public boolean support(AC ac) {
		return (voltage == ac.outputAC());
	}

	@Override
	public int outputDC5V(AC ac) {
		int adapterInput = ac.outputAC();
		//变压器...
		int adapterOutput = adapterInput / 22;
		System.out.println("使用JapanPowerAdapter变压适配器，输入AC:" + adapterInput + "V" + "，输出DC:" + adapterOutput + "V");
		return adapterOutput;
	}
}
